"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BadgeWebLayout = void 0;

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _configContext = require("../../../extends/configContext");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var BadgeWebLayout = function BadgeWebLayout(_ref) {
  var children = _ref.children,
      info = _ref.info,
      dot = _ref.dot,
      color = _ref.color,
      square = _ref.square,
      className = _ref.className,
      style = _ref.style,
      circle = _ref.circle;

  var _useConfig = (0, _configContext.useConfig)(),
      clsPrefix = _useConfig.clsPrefix;

  return /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)("".concat(clsPrefix, "-badge"), className),
    style: style
  }, children, dot && /*#__PURE__*/_react.default.createElement("div", {
    className: "".concat(clsPrefix, "-badge__dot")
  }), !dot && square && info && /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)("".concat(clsPrefix, "-badge__info"), _defineProperty({}, "".concat(clsPrefix, "-badge__info--square"), square)),
    style: {
      backgroundColor: color
    }
  }, info), !dot && circle && info && /*#__PURE__*/_react.default.createElement("div", {
    className: "".concat(clsPrefix, "-badge__circle"),
    style: {
      backgroundColor: color
    }
  }, info));
};

exports.BadgeWebLayout = BadgeWebLayout;